/**
 * 费用明细：表格展示
 */
import React from 'react';
import { Table } from 'antd';
import page from '../../page.less';

function TableInfo({
  columns,
  title,
  dataSource,
  id,
  state,
  children,
  // tableTitle,
  pagination = false,
  bordered = true,
}: any) {
  return (
    <div className={`${page.page} ${page.card}`} id={id}>
      {title && (
        <div className={page.dotTitle}>
          {title}
          {state && (
            <div className={page.state}>
              {state.label}：{Number(state.value).toFixed(2)}
            </div>
          )}
        </div>
      )}

      <Table
        // title={tableTitle && <span>{tableTitle}</span>}
        columns={columns}
        bordered={bordered}
        dataSource={dataSource}
        pagination={pagination}
      />
      {children}
    </div>
  );
}

export default TableInfo;
